<?php include "menu.phtml"; $userTypes = array("1" => $this->translate->_("Pet Owner"), "2" => $this->translate->_("Service Provider")); ?>
<div id="right">
	<div class="rightbox">
		<div class="context"><div class="in"><a href="javascript:void(0);" id="context_menu" class="icon_link the_down"><span></span></a></div></div>
		<h1><?php echo $this->translate->_("Add Friend"); ?></h1>
		<br />
		<?php echo $this->form; ?>
		<?php if(isset($this->sent)): ?>
			<br />
			<?php if(isset($this->users) && count($this->users) > 0): ?>
				<?php echo $this->paginationControl($this->users, 'Elastic', 'pagination-controls.phtml', array('pos' => 'top')); ?>
				<?php
					echo $this->partial('user-template.phtml', array(
						'translate' => $this->translate,
						'usertypes' => $userTypes,
						'data' => $this->users,
						'identity' => $this->identity,
						'links' => 'add',
						'per_row' => 2
					));
				?>
				<?php echo $this->paginationControl($this->users, 'Elastic', 'pagination-controls.phtml', array('pos' => 'bot')); ?>
			<?php else: ?>
				<b class="red bigger"><?php echo $this->translate->_("No users found."); ?></b>
			<?php endif; ?>
		<?php endif; ?>
	</div>
</div>
<script type="text/javascript">
	var Privacy = function() {
		function hideFields() {
			$('[class*="private"], [class*="empty"]').each(function(s, i){
				var td = $(i).parent().parent();
				$(i).parent().remove();

				if(!td.has('span').length > 0)
					td.find('div').remove();
			});
		};

		function __construct() {
			hideFields();
		};

		return {
			init: __construct
		}
	}();

	READY(Privacy.init);
</script>